package com.cloudkinto.service.order;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.bo.order.OrderMbQueryBo;
import com.cloudkinto.bo.order.OrderMbUpdateAccountSecretBo;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.OrderMabangDo;
import com.cloudkinto.service.order.vo.mabang.MbAuthStorageVo;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 马帮mabang订单表(包含商品) service接口
 * </p>
 *
 * @author hua
 * @since 2024-09-09
 */
public interface OrderMabangService extends IService<OrderMabangDo> {

    SingleResult addInit();

    Object add(Object req, Long userId);

    SingleResult updateInit(Long id);

    Object update(Object updateVo, Long userId);

    int delete(Long id, Long userId);

    Object detail(Long id);

    SingleResult pageInit(Long companyId);

    PageResult getListPage(OrderMbQueryBo bo);

    /**
     * 修改授权通过后登陆拿到的认证token
     *
     * @return 操作状态
     */
    SingleResult<String> updateMbAccessToken(OrderMbUpdateAccountSecretBo bo, Long companyId);

    /**
     * 马帮授权
     * 用token换accessToken
     *
     * @param companyId 公司id
     * @return 认证成功返回回调地址
     */
    SingleResult<String> mbAuthorize(Long companyId,Long storageId);

    /**
     * 马帮订单同步
     */
    SingleResult mbOrderSync(Long companyId, Date startDate, Date endDate);

    /**
     * 发送hwc商品
     */
    SingleResult sendHwcProductToMabang(Long companyId);

    /**
     * 检查是否授权
     */
    @Deprecated
    SingleResult<Boolean> checkAuth(Long companyId);

    List<MbAuthStorageVo> getMbAuthStorageList(Long companyId);
}
